/*
 * @Author: zwc 6537397+uni-yunApp@user.noreply.gitee.com
 * @Date: 2023-11-13 15:25:52
 * @LastEditors: zwc 6537397+uni-yunApp@user.noreply.gitee.com
 * @LastEditTime: 2023-12-25 17:50:03
 * @FilePath: \covue-main\lib\core\commands.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
const program = require('commander')
const { createProject,createPage,getGithubUserProjects } = require('./actions')
// 命令提示
const createCommands = () => {

  // 创建项目的交互命令
  // .command('create <project> [projectType] [other...]')
  program
    .command('create <project>')
    .alias('c')
    .description('创建一个项目模板')
    .action((project)=>{
     createProject(project)
    });
    // 创建页面的交互命令
  program
    .command('addpage <pageName> [pageType] [needFolder]')
    .alias('a')
    .description('创建一个 vue2 or vue3 页面模板')
    .action((pageName,pageType,needFolder) => {
      //指定page为文件夹和文件名字
      createPage(pageName,pageType,needFolder)
  });
  // 用户自定义仓库设置
  program
  .command('set <userName>')
  .description('拉取自定义github账户项目模板')
  .action((userName) => {
    getGithubUserProjects(userName)
});
}

module.exports = createCommands